package chai.ningning.bytes;

import java.io.*;

public class CopyFileTest {
    public static void main(String[] args) throws IOException {

        File source = new File( "E:/Code/TwinPrime.java" );
        File copyFile = new File( "E:/Code/itlaobing.txt" );

        InputStream in = new FileInputStream(source);
        OutputStream out = new FileOutputStream(copyFile);

        byte[] bytes = new byte[100];
        int b;
        while ((b=in.read(bytes))!= -1){
            out.write(bytes,0,b);
        }

        out.close();
        in.close();
    }
}
